package cmdb_blacklist_ignore_v1

import (
	"dfx_cmdb/cmdb-gateway/internal/logic/cmdb_blacklist_ignore_v1"
	"dfx_cmdb/cmdb-gateway/internal/svc"
	"dfx_cmdb/common/response"
	"net/http"
)

func GetAllIgnoreRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := cmdb_blacklist_ignore_v1.NewGetAllIgnoreRuleLogic(r.Context(), svcCtx)
		resp, err := l.GetAllIgnoreRule()
		if err != nil {
			response.Response(r, w, nil, err)
		} else {
			response.Response(r, w, resp.UpdateIgnoreRuleRequest, nil)
		}
	}
}
